package exam.test5;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2020-08-19
 * Time: 22:04
 */
public class TestMain {

    public static void main(String[] args) {
        Pattern pattern = Pattern.compile("^\\d{2}-\\d{2}-(\\d{2})\\d{2},\\d{2}-\\d{2}-(?!\\1)\\d{4}$");
//        Pattern pattern = Pattern.compile("^\\d{2}-\\d{2}-(\\d{2})\\d{2},\\d{2}-\\d{2}-\\1\\d{2}$");

//        String msg = "01-02-2079,02-01-2019";
        String msg = "01-02-1979,02-01-2019";
        Matcher match = pattern.matcher(msg);
        if (match.find()) {
            System.out.println("11111111111");
        } else {
            System.out.println("--------------------------");
        }
    }
}
